﻿using System;
using System.Linq;

class SieveOfEratosthenes
{
    static void Main()
    {
        bool[] primesArray = new bool[10000001];

        for (long i = 2; i < primesArray.Length; i++)
        {
            if (primesArray[i]==false)
            {
                for (long j = i; j < primesArray.Length; j++)
                {
                    if (i * j < primesArray.Length)
                    {
                        primesArray[i * j] = true;  
                    }
                    else
                    {
                        break;
                    }
                    
                }
            }
        }

        //Print primes from 2 to 200
        for (int i = 2; i < 200; i++)
        {
            if (primesArray[i]==false)
            {
                Console.WriteLine(i);
            }
        }


    }
}
